<!DOCTYPE html>
<html xmlns:ui='http://java.sun.com/jsf/facelets'
      xmlns:h='http://java.sun.com/jsf/html'
      xmlns:f='http://java.sun.com/jsf/core' lang='en'>
<body>
<ui:composition template='snippets/template.xhtml'>
    <ui:define name='title'>Neue Messgrösse anlegen</ui:define>
    <ui:define name='content'>
        <f:view>
        <h:form id='MeasurandForm'>
            <table>
            <tr>
                <td>Name Messgrösse:</td>
                <td>
                <h:inputText id='measurandName' value='#{ MeasurandBean.measurandName }' required='true'>
                    <f:validateLength minimum='1' maximum='30' />
                </h:inputText>
                </td>
                <td><h:message for='measurandName' /></td>
            </tr>
            <tr>
                <td>Beschreibung Messgrösse:</td>
                <td>
                <h:inputTextarea id='measurandDescription' value='#{ MeasurandBean.measurandDescription }' required='true' > 
                    <f:validateLength minimum='1' maximum='100' />
                </h:inputTextarea><br/>
                </td>
                <td><h:message for='measurandDescription' /></td>
            </tr>
            
            <tr>
                <td>Name Standardeinheit:</td>
                <td>
                <h:inputText id='defaultUnit' value='#{ MeasurandBean.defaultUnit }' required='true'>
                    <f:validateLength minimum='1' maximum='30' />
                </h:inputText>
                </td>
                <td><h:message for='defaultUnit' /></td>
            </tr>
                     
            <tr>
                <td>Kürzel Standardeinheit:</td>
                <td>
                <h:inputText id='unitSymbol' value='#{ MeasurandBean.unitSymbol }' required='true'>
                    <f:validateLength minimum='1' maximum='5' />
                </h:inputText>
                </td>
                <td><h:message for='unitSymbol' /></td>
            </tr>
           
            <h:outputText rendered='#{ MeasurandBean.admin }'>
            <tr>
                <td>Art:</td>
                <td>
                    <h:selectOneRadio value='#{ MeasurandBean.type }'>
                   		<f:selectItem  itemLabel='Öffentlich' itemValue='public' />
                    	<f:selectItem  itemLabel='Privat' itemValue='private' />
                    </h:selectOneRadio>
                </td>
                <td><h:message for='type' /></td>
            </tr>
           
            </h:outputText>
           
            <tr>
                    <td> </td>
                   <td><h:commandButton action='#{ MeasurandBean.process }' value='Erstellen' />
                   <h:commandButton action='cancel' value='Abbrechen' />
                   </td>
                   <td> </td>
              </tr>
            </table>   
        </h:form>
        </f:view>
    </ui:define>
</ui:composition>
</body>
</html>
